package cn.schoolwow.quickdao.module.initial.service;

import cn.schoolwow.quickdao.module.entity.flow.SetEntityMapFlow;
import cn.schoolwow.quickdao.module.initial.flow.table.*;
import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;

public class InitialDAOCompositeBusiness implements CompositeBusinessFlow {
    @Override
    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
        quickFlowExecutor.next(new SetEntityMapFlow())
                .next(new LogRecordFlow())
                .next(new BeforeAutomaticCreateFlow())
                .next(new AutomaticDeleteTableAndPropertyFlow())
                .next(new AutomaticCreateTableFlow())
                .next(new AutomaticCreateColumnFlow())
                .next(new AutomaticUpdatePropertyFlow())
                .next(new AfterAutomaticCreateFlow());
    }

    @Override
    public String name() {
        return "初始化DAO对象";
    }
}
